home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 286_02 / init.c < prev    next >
Text File  |  1989-05-23  |  896b  |  38 lines

  1. #include <stdio.h>
  2. #include <gds.h>
  3.  
  4. GRADinit()
  5. {
  6.     int count;
  7.     long curtime, time();
  8.  
  9. #ifdef MSC4
  10.     extern int _amblksiz;
  11.     _amblksiz=8000;
  12. #endif
  13. #ifdef JLASER
  14.     if (initjlsr()==ERROR) {
  15.         fprintf(stderr,"Unable to initialize JLASER\n");
  16.         exit(1);
  17.     }
  18. #endif
  19.     count=0;
  20.     curtime=time(NULL);
  21.     while (curtime==time(NULL));
  22.     curtime=time(NULL);
  23.     count++;
  24.     while (curtime==time(NULL)) count++;
  25.     TEN_MS=(int) (333L *count/187);   /* 333 empty loops in IBM PC takes 10ms
  26.                                      IBM PC gives a average of 187 count */
  27.  
  28. cleanup(exitcode)
  29. {
  30. #ifdef JLASER
  31.     cleanjlsr();
  32. #endif
  33.     if (exitcode)       /* if exitcode is non-zero, error exit */
  34.         exit(exitcode);
  35. }
  36.  
  37.